package com.gshrms.statistics.controller;

import com.gshrms.common.core.controller.BaseController;
import com.gshrms.common.core.domain.AjaxResult;
import com.gshrms.statistics.domain.params.StatisticsStaffParams;
import com.gshrms.statistics.mapper.StatisticsStaffMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 统计模块
 *
 * @author ruoyi
 * @date 2024-11-13
 */
@RestController
@RequestMapping("/statistics/staff")
public class StatisticsStaffController extends BaseController {
    @Autowired
    private StatisticsStaffMapper statisticsStaffMapper;

    /**
     * 在职员工司龄分布
     */
    @PostMapping(value = "/joinAge")
    public AjaxResult joinAge(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsJoinAge(params));
    }

    /**
     * 在职员工工龄分布
     */
    @PostMapping(value = "/workAge")
    public AjaxResult workAge(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsWorkAge(params));
    }

    /**
     * 在职员工年龄分布
     */
    @PostMapping(value = "/age")
    public AjaxResult age(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsAge(params));
    }

    /**
     * 在职员工学历分布
     */
    @PostMapping(value = "/education")
    public AjaxResult education(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsEducation(params));
    }

    /**
     * 在职员工性别分布
     */
    @PostMapping(value = "/gender")
    public AjaxResult gender(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsGender(params));
    }

    /**
     * 在职员工性质分布
     */
    @PostMapping(value = "/staffStatus")
    public AjaxResult staffStatus(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsStaffStatus(params));
    }

    /**
     * 在职员工婚姻情况分布
     */
    @PostMapping(value = "/maritalStatus")
    public AjaxResult maritalStatus(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsMaritalStatus(params));
    }

    /**
     * 在职员工政治面貌分布
     */
    @PostMapping(value = "/politicalOutlook")
    public AjaxResult politicalOutlook(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsPoliticalOutlook(params));
    }

    /**
     * 部门人数统计
     */
    @PostMapping(value = "/orgPeople")
    public AjaxResult orgPeople(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsOrgPeople(params));
    }

    /**
     * 职位人数top10统计
     */
    @PostMapping(value = "/postPeopleTop10")
    public AjaxResult postPeopleTop10(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsPostPeopleTop10(params));
    }

    /**
     * 月度入转离人数
     */
    @PostMapping(value = "/changeByMonth")
    public AjaxResult changeByMonth(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsChangeByMonth(params));
    }

    /**
     * 年度入转离人数
     */
    @PostMapping(value = "/changeByYear")
    public AjaxResult changeByYear(@RequestBody StatisticsStaffParams params) {
        return success(statisticsStaffMapper.statisticsChangeByYear(params));
    }


}
